<template>
  <div>
    <el-form
      :model="ruleForm"
      ref="ruleForm"
      label-width="100px"
      class="demo-ruleForm"
    >
      <el-form-item label="角色名称">
        <el-input v-model="ruleForm.RoleName"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import axios from "@/unit/request";
export default {
  data() {
    return {
      ruleForm: {
        roleName: "",
      },
    };
  },

  methods: {
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          axios.post("/Role/Insert", this.ruleForm).then((res) => {
            if (res.data.code == 1) {
              this.$message.success(res.data.message);

              this.$emit("OnSave");
            }
          });
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
  },
};
</script>
<style>
</style>